import { reactive, onMounted, onBeforeUnmount } from 'vue'
export default function () {
    let point = reactive({
        pageX: 0,
        pageY: 0,
    })


    function showMouse(event) {
        point.pageX = event.pageX;
        point.pageY = event.pageY
        console.log(event.pageX);
    }

    onMounted(() => {
        window.addEventListener('click', showMouse)
    }),

        onBeforeUnmount(() => {
            window.removeEventListener('click', showMouse)
        })
    return point
}
